<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
</html>
<script>
	//求10个学生的随机成绩（0-100），请统计大于等于平均成绩的人数。
	var arr = [];
	var he = 0;
	//循环去生成十个成绩，添加进arr
	for(var i = 0; i < 10; i++){
		arr.push(parseInt(Math.random()*100 + 0.5));
		he += arr[i];
	};
	console.log(arr, he);
	//求数组和
	var pingjun = he / 10;
	//for(var j = 0; j < arr.length; j++){
	//	pingjun += arr[j];
	//};
	//pingjun = pingjun / 10;
	console.log(pingjun);
	//统计 
	var count = 0;
	for(var x = 0; x < arr.length; x++){
		if(arr[x] >= pingjun){
			count++;
		}
	};
	console.log(count)
</script>
